//
//  HeaderCollectionReusableView.m
//  UICollectionView
//
//  Created by smith on 15/12/10.
//  Copyright © 2015年 smith. All rights reserved.
//

#import "HeaderCollectionReusableView.h"




#import "DBcommonUtils.h"

//获取屏幕宽度
#define ScreenWidth  [UIScreen mainScreen].bounds.size.width

//获取屏幕高度
#define ScreenHeight [UIScreen mainScreen].bounds.size.height



@implementation HeaderCollectionReusableView


-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        
        
        self.dateLabel  = [[UILabel alloc]initWithFrame:CGRectMake( ScreenWidth/3   , 0, ScreenWidth/3 , ScreenWidth/7 )];
        
        self.dateLabel.font = [UIFont systemFontOfSize:12];
        self.dateLabel.textColor =[UIColor blackColor];
        self.dateLabel.textAlignment = 1;
        self.dateLabel.backgroundColor = [UIColor colorWithRed:0.94 green:0.97 blue:1 alpha:1] ;
        
        
        self.lastBt = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.lastBt setImage:[UIImage imageNamed:@"返回@3x.png"] forState:UIControlStateNormal];
        self.lastBt.frame = CGRectMake(0 ,0, ScreenWidth/3  , ScreenWidth/7);
        [self.lastBt setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self.lastBt setBackgroundColor:[UIColor colorWithRed:0.94 green:0.97 blue:1 alpha:1]];
        
        
        self.nextBt = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.nextBt setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self.nextBt setImage:[UIImage imageNamed:@"向后箭头@3x.png"] forState:UIControlStateNormal];
        self.nextBt.frame = CGRectMake(ScreenWidth*2/3  ,0, ScreenWidth/3, ScreenWidth/7);
        [self.nextBt setBackgroundColor:[UIColor colorWithRed:0.94 green:0.97 blue:1 alpha:1]];
        
        
        
        [self addSubview:self.dateLabel];
        [self addSubview:self.lastBt];
        [self addSubview:self.nextBt];
        UIView *  priceView = [[UIView alloc]initWithFrame:CGRectMake(0, ScreenWidth/7, ScreenWidth, ScreenWidth/7)];
        
        NSArray * weekArray = @[@"日",@"一",@"二",@"三",@"四",@"五",@"六"];
        
        for (int i = 0; i < 7; i++)
            
        {
        
            UILabel * weekView= [[UILabel alloc]initWithFrame:CGRectMake(i * ScreenWidth/7, 0, ScreenWidth/7, ScreenWidth/7)];
            weekView.textAlignment = 1;
            weekView.text = weekArray[i];
            weekView.backgroundColor =[UIColor colorWithRed:0.94 green:0.97 blue:1 alpha:1];
            weekView.font = [UIFont systemFontOfSize:12];
            [priceView addSubview:weekView];
        }
        
        [self addSubview:priceView];

    }

   
    return self;
}

@end
